package com.vegasoft.games.tetrixml;

import java.io.Serializable;

public class Grid implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6851060046042833832L;

	private boolean[][] composition;
	private int height = 0;
	private int width = 0;

	public Grid(int width, int height) {
		this.width = width;
		this.height = height;
		composition = new boolean[height][width];
	}

	/**
	 * @return the height
	 */
	public int getRows() {
		return height;
	}

	/**
	 * @return the width
	 */
	public int getColumns() {
		return width;
	}
	
	public boolean exists(int x, int y) {
		if(x>width || x<0 || y>height || y<0)
			return false;
		return composition[y][x];
	}
	
	public boolean[][] getGeometry() {
		return composition;
	}
}
